package com.mallcloud.mall.mall.api.entity.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.util.Optional;

@ApiModel(value="ProPayRollBackCoupon",description="买券回滚过程对象")
@Data
@ToString
public class ProPayRollBackCoupon {

    @ApiModelProperty("支付订单号")
    private String payNo;

    @ApiModelProperty(value="执行状态",hidden=true)
    private Integer messageId;
    @ApiModelProperty(value="执行提示信息",hidden=true)
    private String message;

	public boolean isSuccess() {
		return Optional.ofNullable(this.messageId).map(x -> x.equals(0)).orElse(false);
	}
}
